package com.dingpeikeji.quickdeer.modules.rentproduct.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.dingpeikeji.quickdeer.core.common.persistence.Page;
import com.dingpeikeji.quickdeer.core.common.service.CrudService;
import com.dingpeikeji.quickdeer.core.modules.line.dao.TLineDao;
import com.dingpeikeji.quickdeer.core.modules.line.entity.TLine;
import com.dingpeikeji.quickdeer.core.modules.realsche.entity.TRealsche;
import com.dingpeikeji.quickdeer.modules.rentproduct.dao.ShareProductDao;
import com.dingpeikeji.quickdeer.modules.rentproduct.dao.TDemandsDao;
import com.dingpeikeji.quickdeer.modules.rentproduct.entity.ShareRentproduct;
import com.dingpeikeji.quickdeer.modules.rentproduct.entity.TDemands;

/**
 * 用户需求Service
 */
@Service
@Transactional(readOnly = true)
public class ShareProductService extends CrudService<ShareProductDao, ShareRentproduct> {
	
	@Autowired
	private ShareProductDao shareProductDao;

	public int insert(ShareRentproduct shareRentproduct) {
		int result = shareProductDao.insert(shareRentproduct);
		return result;
	}

	public ShareRentproduct getInfo(String id) {
		return shareProductDao.getInfo(id);
	}

	public void updateSellAmount(String id,String purchasenum) {
		shareProductDao.updateSellAmount(id,purchasenum);
	}

	public void updateStatus(String shareid,String status) {
		shareProductDao.updateStatus(shareid,status);
	}

	public List<ShareRentproduct> getAllShareProduct() {
		return shareProductDao.getAllShareProduct();
	}

	public String getLinePic(Integer rentgrpid) {
		return shareProductDao.getLinePic(rentgrpid);
	}
	public Page<ShareRentproduct> findPage(Page<ShareRentproduct> page, ShareRentproduct shareRentproduct) {
		shareRentproduct.setPage(page);
		List<ShareRentproduct> list = shareProductDao.findList(shareRentproduct);
		page.setList(list);
		return page;
	}

	public ShareRentproduct getElseInfo(String sid) {
		return shareProductDao.getElseInfo(sid);
	}

	public int updateSuccess(String sid) {
		return shareProductDao.updateSuccess(sid);
	}

	public void updateDelFlag() {
		shareProductDao.updateDelFlag();
	}

	public Page<ShareRentproduct> findDelPage(Page<ShareRentproduct> page, ShareRentproduct shareRentproduct) {
		shareRentproduct.setPage(page);
		List<ShareRentproduct> list = shareProductDao.findDelList(shareRentproduct);
		page.setList(list);
		return page;
	}

	public List<ShareRentproduct> selectDelFlag(){
		return shareProductDao.selectDelFlag();
	}

	public List<String> getDepartList(ShareRentproduct sharetype) {
		return shareProductDao.getDepartList(sharetype);
	}

	public List<String> getDestList(ShareRentproduct sharetype) {
		return shareProductDao.getDestList(sharetype);
	}
	
	public List<String> getBoardList(ShareRentproduct sharetype){
		return shareProductDao.getBoardList(sharetype);
	}
	
	public List<String> getDayList(ShareRentproduct sharetype){
		return shareProductDao.getDayList(sharetype);
	}

}